#!/bin/bash

mkdir ./src/gsoapSrc
mkdir ./include/gsoapHead

# 引入依赖
cp ./gsoap/gsoap/stdsoap2.h ./include/gsoapHead
cp ./gsoap/gsoap/stdsoap2.cpp ./src/gsoapSrc
cp ./gsoap/gsoap/import/dom.h ./include/gsoapHead
cp ./gsoap/gsoap/dom.cpp ./src/gsoapSrc
cp ./gsoap/gsoap/plugin/wsseapi.h ./include/gsoapHead
cp ./gsoap/gsoap/plugin/wsseapi.cpp ./src/gsoapSrc
cp ./gsoap/gsoap/plugin/wsaapi.h ./include/gsoapHead
cp ./gsoap/gsoap/plugin/wsaapi.c ./src/gsoapSrc/wsaapi.cpp
cp ./gsoap/gsoap/plugin/mecevp.h ./include/gsoapHead
cp ./gsoap/gsoap/plugin/mecevp.c ./src/gsoapSrc/mecevp.cpp
cp ./gsoap/gsoap/plugin/smdevp.h ./include/gsoapHead
cp ./gsoap/gsoap/plugin/smdevp.c ./src/gsoapSrc/smdevp.cpp
cp ./gsoap/gsoap/plugin/threads.h ./include/gsoapHead
cp ./gsoap/gsoap/plugin/threads.c ./src/gsoapSrc/threads.cpp
cp ./gsoap/gsoap/custom/struct_timeval.h ./include/gsoapHead
cp ./gsoap/gsoap/custom/struct_timeval.c ./src/gsoapSrc/struct_timeval.cpp

# 将生成的代码框架移动到src和include里
mv soapC.cpp ./src/gsoapSrc
mv soapClient.cpp ./src/gsoapSrc
mv soapH.h ./include/gsoapHead
mv soapStub.h ./include/gsoapHead
mv wsdd.nsmap ./include/gsoapHead

# 删除无用文件
rm *.nsmap
rm onvif.h
